//TODO 有待优化
export default class HashManager {
    static hashCnt: number = 0;
    static map: Map<any, number> = new Map();
    public static getHash(obj: any) {
        if (!this.map.has(obj))
            this.map.set(obj, ++this.hashCnt);
        return this.map.get(obj);
    }

}
export function hash(obj: any, prefix: string = "") {
    return `hash${HashManager.getHash(obj)}_${prefix}`;
}